import React, { Component } from 'react';
import { Row,Col } from 'antd';
import 'antd/dist/antd.css';
import HotSongRecommend from './hotSongRecommend';
import docCookies from "../../api/docCookies"
import { getSongRecommend } from '../../api';


class IndexContent extends Component {


    constructor(props){
        super(props);
    }


    componentDidMount(){

        getSongRecommend().then((res) => {
            if (res.data.code === 200) {
                this.props.recommendSongFunc(res.data['songs']);
            } else {
                console.log("请求错误...");
            }
        }).catch( err => {
            console.log( err )
        })

    }

    render() {
        const recommendSong = this.props.recommendSong.data;

        //登录凭证
        let loginCertificate = docCookies.getItem("__csrf");

        return (
            <div style={{ minWidth:"1150px" }}>
                {/* <MusicPlay /> */}
                <Row gutter={10}>
                    <Col span={3}></Col>
                    <Col span={18}>
                        <div className='hotRecommend' style={{ paddingLeft:"20px",paddingTop:"50px",paddingBottom:"80px",paddingRight:"30px" }}>
                            <HotSongRecommend hotCommendSong={recommendSong}/>
                        </div>
                    
                    </Col>
                    <Col span={3}></Col>
                </Row>
            </div>
        )
    }
}


export default IndexContent;
